home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 24 / 024.d81 / speed boat (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  4KB  |  115 lines

  1. 35 printchr$(142):forj=0to63:readi:poke12288+j,i:next:rem read in sprite data
  2. 40 poke2040,192:v=53248:pokev+39,2
  3. 65 poke53280,5:poke53281,14:pokev+29,0
  4. 70 print"[147][158]"tab(10)" speed boat race"
  5. 75 print"[144]score is elapsed time +5 for each gate  missed. lowest score wins."
  6. 80 :
  7. 90 print"[144]press [158]<[144] to go left, [158]>[144] to go right."
  8. 95 print"try to go through all gates[160][150][167][190][164][164][164][164][164][188][165]"
  9. 100 print"[155]and make all jumps [158][169]   [223][146][155]that you can."
  10. 105 print"[144]hitting an island will cause a delay!"
  11. 110 print"[158]no. of players (1-4) ";
  12. 112 getnp$:ifnp$<"1"ornp$>"4"then112
  13. 113 np=val(np$)
  14. 114 printnp
  15. 115 print"no. of rounds (1-5) ";
  16. 116 getnr$:ifnr$<"1"ornr$>"5"then116
  17. 117 nr=val(nr$)
  18. 119 print nr
  19. 120 r=1:p=1:print" player #";p:m$="[158]"
  20. 130 printm$"player"p"-- select skill level desired:"
  21. 135 print"1=beginner":print"2=intermediate"
  22. 140 print"3=advanced":print"4=olympic":print"5=professional"
  23. 150 a$="":geta$
  24. 160 ifa$="1"thens$="  beginner":goto210
  25. 170 ifa$="2"thens$="intermediate":goto210
  26. 175 ifa$="3"thens$="  advanced":goto210
  27. 180 ifa$="4"thens$="  olympic":goto210
  28. 185 ifa$="5"thens$="professional":goto210
  29. 190 c1=c1+1:ifc1=20thenc1=0
  30. 195 ifc1=10thenm$="[154]"
  31. 200 ifc1=19thenm$="[158]"
  32. 205 print"[145][145][145][145][145][145][145][145]":goto130
  33. 210 sk=val(a$):rn=(sk+1)/10
  34. 215 ifsk<1orsk>5orsk<>int(sk)thenprint"[145][145][145][145][145][145][145][145][145][145]":goto130
  35. 220 sk=35-5*sk
  36. 230 print"[147]":s=54272
  37. 240 fori=1to12step2
  38. 245 l=int(rnd(1)*38)+.5:printtab(l);"[153][166][220][166][166][145]":next
  39. 250 b=1484:c=54272:pokeb,28:pokeb+c,14:pokeb+37,32:pokeb+38,32:pokeb+40,32
  40. 260 poke1475,106:poke1476,126:poke1475+c,10:poke1476+c,10:rem flags
  41. 265 poke1490,124:poke1491,116:poke1490+c,10:poke1491+c,10
  42. 270 print"[158]";s$;"  [146]"
  43. 275 x1=175:pokev+1,125:pokev,x1:pokev+21,1
  44. 300 geta$:ifa$=""then300
  45. 310 ti$="000000"
  46. 315 gosub830:rem turn on sound
  47. 320 rem start of action
  48. 340 b=b+d:pokeb,f:pokeb+c,14
  49. 345 ifpeek(197)<>64then350
  50. 347 d=0:f=28:pokeb-41,73:pokeb+c-41,3:pokeb-39,85:pokeb+c-39,3
  51. 350 ifpeek(197)<>47then355
  52. 352 d=-1:f=28:pokeb-41,73:pokeb+c-41,3:pokeb-39,85:pokeb+c-39,3
  53. 355 ifpeek(197)<>44then357
  54. 356 d=+1:f=28:pokeb-41,73:pokeb+c-41,3:pokeb-39,85:pokeb+c-39,3
  55. 357 x1=x1+(d*8):ifx1>255thenpokev+16,1:pokev,x1-255:goto360
  56. 358 pokev+16,0:pokev,x1
  57. 360 pokeb,32
  58. 365 ifskthenfort=1tosk:next
  59. 370 g=g+1:ifg<28then410
  60. 380 g=0:e=e+1:ife=10thenprint"======================================="
  61. 390 ife=10thenprint"=======================================":goto470
  62. 400 x=int(rnd(1)*25)+2:printtab(x)"[150][167][190][154][164][164][164][164][164][164][164][150][188][180]":goto470:rem print gates
  63. 410 ifg=10thenx=int(rnd(1)*30)+4:printtab(x)"[158][169]   [223]":rem jump ramp
  64. 420 ifrnd(1)>rnthen440
  65. 430 l=int(rnd(1)*30)+1:printtab(l)"[153][168][157][157][166][166][145]":goto450
  66. 440 print:rem  print blank line
  67. 450 ifpeek(b)<>32then500:rem test for collision
  68. 470 goto320
  69. 490 rem what did boat collide with?:
  70. 500 ifpeek(b)=100thenh=h+1:fort=1to30:next:goto470:rem goes thru a gate
  71. 510 ifpeek(b)=61thenh=9-h:tm=int(ti/60):pokev+21,0:goto640:rem finish line
  72. 520 ifpeek(b)=124orpeek(b)=126thenpokeb-40,91:goto600:rem hits a flag
  73. 530 ifpeek(b)<>160andpeek(b)<>223andpeek(b)<>233then580:rem hit a jump ramp
  74. 540 g=g+10:gosub805:gosub870:gosub830:ifsk>0thensk=sk-2
  75. 560 goto470
  76. 580 ifpeek(b)=92orpeek(b)=102thenpokeb-40,91:goto600:rem hits an island
  77. 590 goto470
  78. 600 gosub805:gosub850:forj=2to0step-1:fori=5-jto5+j:poke53267,i:nexti,j
  79. 610 os=os+1:fort=0to127:pokeb-40+c,int(t/40)+2:next
  80. 630 gosub805:gosub830:goto470
  81. 640 gosub810:rem shut off sound
  82. 650 u=0:print"[147] objects hit=";os:print" gates missed=";h
  83. 655 print" time="tm :sc=tm+5*h
  84. 660 print" score="sc
  85. 670 z(p)=z(p)+sc:print"        round ";r:print" ":fori=1tonp
  86. 680 print"  player #";i;z(i):next
  87. 690 sc=0:g=0:e=0:os=0:h=0:ifu=10thenu=0:goto130
  88. 700 p=p+1:ifp<np+1then130
  89. 710 r=r+1:ifr<nr+1thenp=1:goto130
  90. 720 print"        game over "
  91. 725 poke198,0
  92. 730 print"[158]do you wish to play again (y/n)"
  93. 735 getb$:ifb$<>"y"andb$<>"n" then735
  94. 740 ifb$="y"thenz(1)=0:goto70
  95. 750 print"[147] goodbye! "
  96. 760 fort=1to3000:next:print"[147][144]":poke53280,0:poke53281,0:load"hello connect",8
  97. 800 rem ****sound routines****
  98. 805 rem clear sound registers
  99. 810 forj=1to24:pokes+j,0:next:return
  100. 830 rem sound of wind
  101. 835 pokes+24,5:pokes+5,128:pokes+6,128:pokes+1,40
  102. 840 pokes+4,128:pokes+4,129:return
  103. 850 rem sound of crash
  104. 855 pokes+24,15:pokes+5,28:pokes+1,20:pokes+4,128:pokes+4,129:return
  105. 870 rem jump routine
  106. 875 pokes+24,15:pokes+5,12*16+0:pokes+6,12*16+10
  107. 880 forj=200to100step-1:pokes+1,j:pokes+4,17
  108. 885 r1=r1+1:ifr1=8thengosub895
  109. 890 next:pokes+24,0:return
  110. 895 print:r1=0:return
  111. 900 data0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  112. 905 data0,127,0,0,255,128,0,193,128,0,193,128,0,193,128
  113. 910 data0,193,128,0,193,128,0,193,128,0,193,128,0,255,128
  114. 915 data0,127,0,0,62,0,0,28,0,0,8,0,0
  115.